#ifndef __60STACK_FOR_NONE_POINTER__
#define __60STACK_FOR_NONE_POINTER__

template <typename T>
class StackForNonePointer
{
private:
    enum {MAX_SIZE = 10};
    T items[MAX_SIZE];
    int top{};

public:
    explicit StackForNonePointer();
    bool push(const T &item);
    bool pop(T &item);
    bool isFull();
    bool isEmpty();
    ~StackForNonePointer() {}
};

template <typename T>
StackForNonePointer<T>::StackForNonePointer(){
    top = 0;
}

template <typename T>
bool StackForNonePointer<T>::push(const T &item){
    if (top < MAX_SIZE)
    {
        items[top++] = item;
        return true;
    }
    else
        return false;
}

template <typename T>
bool StackForNonePointer<T>::pop(T &item)
{
    if (top > 0)
    {
        item = items[--top];
        return true;
    }else
        return false;
}

template<typename T>
bool StackForNonePointer<T>::isFull() {
    return top == MAX_SIZE;
}

template<typename T>
bool StackForNonePointer<T>::isEmpty() {
    return top == 0;
}

#endif

